package goods;

public class GoodItem {
    private String name;
    private double price;
    private int id;
    private String type;
    private int num = 0;
    private double priceSum;


    public GoodItem(String name, double price, int id, String type, int num) {
        super();
        this.name = name;
        this.price = price;
        this.id = id;
        this.type = type;
        this.num = num;
        priceSum = num * price;
    }


    @Override
    public String toString() {
        return "|  " + id + " | " + name + " | " + price + " | " + num + "  |  " + price * num + " |";
    }


    public void setNum(int num) {
        this.num = num;
    }


    public String getName() {
        return name;
    }


    public double getPrice() {
        return price;
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }


    public int getNum() {
        return num;
    }


    public double getPriceSum() {
        return priceSum;
    }


}
